package myplugin;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.HashMap;
import java.util.List;
import com.nomagic.uml2.ext.jmi.helpers.ModelHelper;
import com.nomagic.magicdraw.core.Application;
import com.nomagic.magicdraw.openapi.uml.ModelElementsManager;
import com.nomagic.magicdraw.openapi.uml.ReadOnlyElementException;
import com.nomagic.magicdraw.openapi.uml.SessionManager;
import com.nomagic.magicdraw.uml.InheritanceVisitor;
import com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper;
import com.nomagic.uml2.ext.jmi.reflect.VisitorContext;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property;
import com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
//import org.freehep.swing.JDirectoryChooser;

import com.nomagic.actions.AMConfigurator;
import com.nomagic.actions.ActionsCategory;
import com.nomagic.actions.ActionsManager;
import com.nomagic.magicdraw.actions.ActionsConfiguratorsManager;
import com.nomagic.magicdraw.actions.ActionsGroups;
import com.nomagic.magicdraw.actions.MDAction;
import com.nomagic.magicdraw.actions.MDActionsCategory;
import com.nomagic.magicdraw.core.Application;
import com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement;
import com.nomagic.magicdraw.uml.symbols.PresentationElement;
import com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property;
import com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.*;


public class MyPlugin extends com.nomagic.magicdraw.plugins.Plugin
{
	private boolean ready = false;
	private WSDLAction wsdlAction;
	private checkingAction CheckingAction;

public void init()
{
	
	wsdlAction = new WSDLAction();
	CheckingAction = new checkingAction();

	//Adding menu option for custom XSD generation
	ActionsConfiguratorsManager.getInstance().addMainMenuConfigurator(new AMConfigurator()
	{

		public void configure(ActionsManager am) {
		ActionsCategory category = (ActionsCategory) am.getActionFor("WSDLGenerator");
		if (category == null) {

			category = new MDActionsCategory("WSDLGenerator", "WSDLGenerator");
			category.setNested(true);
			am.addCategory(category);
		}
		category.addAction(wsdlAction);
		category.addAction(CheckingAction);
	}

	public int getPriority() {
		return AMConfigurator.MEDIUM_PRIORITY;
	}
});
}

public boolean close()
{
	return true;

}
public boolean isSupported()
{
//plugin can check here for specific conditions
//if false is returned plugin is not loaded.
return true;
}
}
